package com.advertising.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "adver_releaseAddr")
public class ReleaseAddr implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer rid;
	private Release aid;// 广告主键
	private Integer addr;// 地区主键

	private Integer customerNumber;// 客户数量

	/** default constructor */
	public ReleaseAddr() {

	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "rid", unique = true, nullable = false)
	public Integer getRid() {
		return rid;
	}
	@ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="aid")
	public Release getAid() {
		return aid;
	}
	  @Column(name="addr",length=30)
	public Integer getAddr() {
		return addr;
	}
	  @Column(name="customerNumber",length=30)
	public Integer getCustomerNumber() {
		return customerNumber;
	}

	public void setRid(Integer rid) {
		this.rid = rid;
	}

	public void setAid(Release aid) {
		this.aid = aid;
	}

	public void setAddr(Integer addr) {
		this.addr = addr;
	}

	public void setCustomerNumber(Integer customerNumber) {
		this.customerNumber = customerNumber;
	}

}
